/*
 * Copyright Radosław Smogura, 2012. All rights reserved.
 *
 * The content of this file is confidential and it is intelectual property
 * of copyright owners.
 * 
 *
 * $URL: http://reprap-ide.googlecode.com/svn/trunk/RepRapIDE/RepRapProject/src/main/java/eu/softper/reprap/generator/NumericFactory.java $
 * $Id: NumericFactory.java 3 2012-11-19 10:58:30Z mail@smogura.eu $
 * $Revision: 3 $
 */
package eu.softper.reprap.generator;

import java.math.BigDecimal;

/**
 *
 * @author rsmogura
 */
public abstract class NumericFactory<T extends Number & Comparable<T>> {
    public abstract T valueOf(double val);
    
    public abstract T valueOf(BigDecimal val);
    
    public abstract boolean isPositive(T t);
    
    public abstract boolean isNegative(T t);
    
    public abstract boolean isNotZero(T t);
    
    public abstract T negate(T t);
    
    public abstract T add(T a, T b);
    
    public abstract T mul(T a, T b);
    
    public abstract T div(T a, T b);
    
    public abstract T round(T a, T r);
    
    /** @return a - b */
    public abstract T subs(T a, T b);
    
    /** @return a % b */
    public abstract T reminder(T a, T b);
    
    public abstract T abs(T t);
    
    /** Fixes degress to [0, 360) range */
    public abstract T degreeAsRemainder(T degree);
    
    public abstract T min(T a, T b);
    
    public abstract T max(T a, T b);
}
